import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  //用于储存数据
  state: {
    userinfo:{},
  },
  getters: {
  },
  //更改state的数据
  mutations: {
    userchange(state,userinfo){
      localStorage.setItem('userinfo',JSON.stringify(userinfo))
      state.userinfo=JSON.parse(localStorage.getItem('userinfo'))
    }
  },
  actions: {
  },
  modules: {
  }
})
